from flask import request,Response,Flask
from datetime import datetime,timedelta

app=Flask(__name__)

@app.route('/')
def post():
    resp=Response('李大宝')
    expires=datetime.now()+timedelta(seconds=50)-timedelta(hours=8)
    resp.set_cookie('lidabao','niubi',expires=expires)
    return resp

@app.route('/delete')
def delete():
    resp=Response('删除了cookie')
    resp.delete_cookie('lidabao')
    return resp


if __name__=='__main__':
    app.run(debug=True)